<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="../css/base.css">
    <link rel="stylesheet" href="../css/sales.css">
    <link rel="stylesheet" href="../css/font-awesome.css">
    <script src="../js/htmlFont.js"></script>
    <title>销量排行</title>
</head>

<body>
    <!-- 头部 -->
    <header>
        <div class="header-top">
            <img src="../images/header_logo.png" alt="">
            <img src="../images/header_app.png" alt="">
        </div>
        <div class="header-footer">
            <input type="text" class="ipt" placeholder="请输入你想比价的商品">
            <a href="javascript:;">搜索</a>
        </div>
    </header>

    <!-- 全部分类 -->
    <div class="allClassify">
        <div class="allClassify-top">
            <p>
                <span>首页</span>
                <span class="fa fa-angle-right"></span>
                <span>全部分类</span>
                <span class="fa fa-angle-right"></span>
            </p>
            <p>平板电视产品销量排行</p>
        </div>
        <div class="tenoftop">
            <ul class="tenoftopul">

            </ul>
        </div>
    </div>

    <!-- 底部 -->
    <footer>
        <div class="brand">
            <p>品牌排行</p>
            <a class="fa fa-chevron-right" href="javascript:;"></a>
        </div>
        <div class="footer-top">
            <ul>
                <li>登录</li>
                <li>注册</li>
                <li class="go"><span class="fa fa-arrow-up"></span> 返回顶部</li>
            </ul>
        </div>
        <div class="footer-footer">
            <div class="shouji">
                <a href="javascript:;">手机APP下载</a>
                <a href="javascript:;"> 慢慢买手机版</a>
                <a href="javascript:;">-掌上比价平台</a>
            </div>
            <a href="javascript:;">m.mammambuy.com</a>

        </div>
    </footer>
</body>

</html>
<script src="../lib/jquery/jquery-1.12.4.js"></script>
<script src="../js/index.js"></script>
<script src="../lib/template/template.js"></script>
<script src="../js/utils.js"></script>
<!-- 平板电视产品销量排行 -->
<script type="text/template" id="tenbrandListTmp">
    {{each result as val key}}
    <a href="./details.html?id={{val.productId}}" target="_blank">
        <li>
            <div class="right-img">{{val.productImg}}</div>
            <div class="neirong">
                <p>{{val.productName}}</p>
                <p>{{val.productPrice}}</p>
                <p>{{val.productQuote}}</p>
                <p>{{val.productCom}}</p>
                <p>☆☆☆☆☆</p>
            </div>
        </li>
    </a>
    {{/each}}
</script>
<script>
    //获取id
    var id = utils.convertToObj(location.search).id;
    // console.log(id);
    $.ajax({
        type: 'post',
        url: 'http://193.112.55.79:9090/api/getbrandproductlist',
        dataType: 'jsonp',
        pagesize: 4,
        data: {
            brandtitleid: id,

        },
        success: function(res) {
            console.log(res);
            template.config("escape", false);
            var htmlStr = template('tenbrandListTmp', res);
            $('.tenoftopul').html(htmlStr);
        }
    })
</script>